﻿using Modules.ActionRun;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VOL.RabbitMq.RabbitMq;

namespace SortingWorkerService
{
    public class ListeningSensingWorker : BackgroundService
    {
        private readonly ILogger<Worker> _logger;
        private RabbitMqClient _rabbitMqClient;

        public ListeningSensingWorker(ILogger<Worker> logger, RabbitMqClient rabbitMqClient)
        {
            _logger = logger;
            _rabbitMqClient = rabbitMqClient;
        }

        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("输液袋最后一袋信号监听");
            while (!stoppingToken.IsCancellationRequested)
            {
                ActionRunHelper.StartMonitor();

                await Task.Delay(100);

            }


        }
    }
}
